package com.neouton.crm.payRecords.mapper;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.crm.entity.SysUserEntity;
import com.neouton.crm.payRecords.entity.PaymentRecords;
import com.neouton.crm.payRecords.entity.PaymentRequest;
import com.neouton.crm.payRecords.entity.PaymentTable;
import com.neouton.crm.pm.entity.SalesProjectManageVO;
import com.neouton.crm.receiptRecords.entity.ReceiptRecords;
import com.neouton.crm.receiptRecords.entity.ReceiptTable;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author Mose
* @description 针对表【payment_records(付款记录)】的数据库操作Mapper
* @createDate 2023-02-03 15:33:29
* @Entity server.PaymentRecords
*/
@Mapper
public interface PaymentRequestMapper {

    /**
     * 付款记录：根据id 查询信息
     *
     * @return list
     */
    List<PaymentRecords> queryPaymentRecordsPage( @Param("vo")PaymentRecords entity);
    /**
     * 付款记录：数据保存
     */
    boolean savePaymentRequest(@Param("vo") PaymentRequest entity);
    /**
     * 付款记录：数据修改
     */
    void updatePaymentRequestById(@Param("vo")PaymentRequest entity);
    /**
     * 付款记录：根据主键id删除
     *
     * @param id 主键
     */
    void deletePaymentRecordsById(Integer id);
    /**
     * 获取详情
     *
     * @param id
     * @return
     */
    PaymentRequest queryPayRequestInfoById(@Param("payRequestId")Integer payRequestId);


    List<PaymentRequest> getPayRequestByPurchaseOrderIds(@Param("poIds")List<Integer> list);

    //供应商视图接口查询
    List<PaymentRequest> getPayRequestByPurchaseOrderIdsAndSupplierId(@Param("poIds")List<Integer> ids, @Param("supplierId")Integer supplierId);

    List<PaymentRequest> queryPayRequestMoney(@Param("vo")PaymentRequest entity);

    void backUpPaymentRequest( @Param("payRequestId")Integer payRequestId, @Param("backUserId")Integer userId);

    PaymentRequest queryPayRequestHistory(Integer approvalId);

    List<PaymentRequest> queryPaymentRequestByProjectId(@Param("projectId")Integer projectId);

    IPage<PaymentRequest> queryPaymentRequestListInfo(@Param("page") IPage page, @Param("entity")PaymentRequest entity, @Param("userList") List<SysUserEntity> userList);

    List<PaymentRequest> queryPaymentRequestListInfo(@Param("entity")PaymentRequest entity, @Param("userList") List<SysUserEntity> userList);

    List<PaymentTable> queryPaymentTablesByApprovalId(Integer approvalId);

    List<PaymentTable> queryPaymentTablesByPayRequestId(Integer payRequestId);

    void updateRequestTableData(@Param("List")List<PaymentTable> list, @Param("approvalId")Integer approvalId);

    void backUpPaymentTable(@Param("payRequestId")Integer payRequestId, @Param("backUserId")Integer userId);

    void updatePaymentTableDataById(@Param("List")List<PaymentTable> list, @Param("payRequestId")Integer payRequestId);

    void updatePayRequestsProjectIdByOpId(@Param("projectId") Integer projectId, @Param("opId") Integer opId);

    Boolean deletePayedRequestById(Integer payRequestId);

    void updatePrIsNotById(@Param("payRequestId")Integer payRequestId,@Param("prIsNot")String prIsNot);

    void updatePrNotById(Integer payRequestId);
}
